#include <iostream>
using namespace std;

int main() {
    int a,b,h,k;
    cin>>a>>h>>b>>k;
    long ans;
    while(h>0&&k>0){
        ans+=(a+b);
        h-=b;
        k-=a;
    }
    if(h<=0&&k<=a) cout<<ans<<endl;
    else if(h<=0) cout<<ans+b*10<<endl;
    else cout<<ans+a*10<<endl;
    return 0;
}
// 64 位输出请用 printf("%lld")